/*
 * PermissionLevel.java
 *
 * Created on July 4, 2005, 11:15 PM
 *
 * To change this basis, choose Tools | Options and locate the basis under
 * the Source Creation and Management node. Right-click the basis and choose
 * Open. You can then make changes to the basis in the Source Editor.
 */

package com.xucia.jsponic.security;

import java.security.acl.Permission;

/**
 *
 * @author Kris Zyp
 */
public enum PermissionLevel implements Cloneable,Permission {
	NONE_LEVEL(0),
	LIMITED_LEVEL(1),
	READ_LEVEL(2),
	APPEND_LEVEL(3),
	VERSION_LEVEL(4),
	WRITE_LEVEL(5);

	PermissionLevel(int level) {
		this.level = level;
	}
	public int level = 1;
	public boolean canVersion() {
		return level > 2; 
	}
	public boolean canWrite() {
		return level > 4;
	}
	public boolean canRead() {
		return level > 1;
	}
	public boolean canAppend() {
		return level > 3;
	}
	public boolean canBrowse() {
		return level > 0;
	}
}
